import request from '@/utils/request'

// 查询租售合同列表
export function listRentalcontract(query) {
  return request({
    url: '/hyj/rentalcontract/list',
    method: 'get',
    params: query
  })
}
export function listhireRentalcontract(query) {
  return request({
    url: '/hyj/rentalcontract/listshop',
    method: 'get',
    params: query
  })
}
// 查询租售合同详细
export function getRentalcontract(id) {
  return request({
    url: '/hyj/rentalcontract/' + id,
    method: 'get'
  })
}

// 新增租售合同
export function addRentalcontract(data) {
  return request({
    url: '/hyj/rentalcontract',
    method: 'post',
    data: data
  })
}

// 修改租售合同
export function updateRentalcontract(data) {
  return request({
    url: '/hyj/rentalcontract',
    method: 'put',
    data: data
  })
}

// 删除租售合同
export function delRentalcontract(id) {
  return request({
    url: '/hyj/rentalcontract/' + id,
    method: 'delete'
  })
}
// 合同撤销
export function getrollbackcontract(id) {
  return request({
    url: '/hyj/rentalcontract/rollback/' + id,
    method: 'get'
  })
}
// 查询已添加默认收费项
export function listmrsf() {
  return request({
    url: '/hyj/chargeitem/notlinkList',
    method: 'get'
  })
}
// 查询未添加默认收费项
export function notlistmrsf() {
  return request({
    url: '/hyj/chargeitem/linkList',
    method: 'get'
  })
}
// 删除默认收费
export function delmrsf(id) {
  return request({
    url: '/zxwy/DefaultCharge/remove/' + id,
    method: 'delete'
  })
}
// 删除租售合同
export function addmrsf(ids) {
  return request({
    url: '/zxwy/DefaultCharge/save/' + ids,
    method: 'get'
  })
}


// 查询已添加默认收费项
export function listmrsfcs() {
  return request({
    url: '/hyj/chargeitem/notlinkListcs',
    method: 'get'
  })
}
// 查询未添加默认收费项
export function notlistmrsfcs() {
  return request({
    url: '/hyj/chargeitem/linkListcs',
    method: 'get'
  })
}
// 删除默认收费
export function delmrsfcs(id) {
  return request({
    url: '/zxwy/DefaultCharge/removecs/' + id,
    method: 'delete'
  })
}
// 删除租售合同
export function addmrsfcs(ids) {
  return request({
    url: '/zxwy/DefaultCharge/savecs/' + ids,
    method: 'get'
  })
}

//查看合同关联收费项目
export function alreadyhtmrsf(id) {
  return request({
    url: '/zxwy/ItemContract/alreadyAdd/' + id,
    method: 'get'
  })
}
//查看未关联合同关联收费项目
export function notalreadyhtmrsf(id) {
  return request({
    url: '/zxwy/ItemContract/notAlreadyAdd/' + id,
    method: 'get'
  })
}
//删除合同项目关联
export function delhtmrsflink(data) {
  return request({
    url: '/zxwy/ItemContract/remove',
    method: 'post',
    data: data
  })
}
//
// 新增未关联合同关联收费项目
export function addhtmrsfcontract(data) {
  return request({
    url: '/hyj/rentalcontract/vo',
    method: 'post',
    data: data
  })
}
